/*
 *
 * Copyright (c) 2021
 * User:Dybala
 * File:HttpContextUtils.java
 * Date:2021/11/24 20:45:24
 */

package com.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class HttpContextUtils {
    public static HttpServletRequest getHttpServletRequest() {
        //获取当前的request
        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    }
}